home *** CD-ROM | disk | FTP | other *** search
/ CD Fun House 1 / CD Fun House (Wayzata Technology).iso / •Games Parlour• / •Maj Jong• / HyperGunshy •••• / HyperGunshy ееее / background_3736.txt < prev    next >
Text File  |  1990-10-08  |  8KB  |  310 lines

  1. -- background: 3736 from stack: in
  2. -- bmap block id: 4300
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: GunShy Background
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: 0000
  11. -- rect: left=1 top=6 right=32 bottom=38
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 11045 / 11045
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Go Home
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   visual effect iris close
  23.   go Home
  24. end mouseUp
  25.  
  26.  
  27.  
  28. -- part 2 (button)
  29. -- low flags: 00
  30. -- high flags: 0000
  31. -- rect: left=465 top=5 right=31 bottom=509
  32. -- title width / last selected line: 0
  33. -- icon id / first selected line: 2478 / 2478
  34. -- text alignment: 1
  35. -- font id: 0
  36. -- text size: 12
  37. -- style flags: 0
  38. -- line height: 16
  39. -- part name: About
  40. ----- HyperTalk script -----
  41. on mouseUp
  42.   push card
  43.   visual effect zoom open
  44.   go to card "About Hyper-GunShy"
  45. end mouseUp
  46.  
  47.  
  48.  
  49. -- part 3 (button)
  50. -- low flags: 00
  51. -- high flags: A003
  52. -- rect: left=0 top=319 right=341 bottom=100
  53. -- title width / last selected line: 0
  54. -- icon id / first selected line: 0 / 0
  55. -- text alignment: 1
  56. -- font id: 0
  57. -- text size: 12
  58. -- style flags: 0
  59. -- line height: 16
  60. -- part name: New
  61. ----- HyperTalk script -----
  62. -- Start a new game
  63.  
  64. on mouseUp
  65.   global icon1, icon2, numicons, sofar, iconlist, changed
  66.   put 0 into icon1
  67.   put 0 into icon2
  68.   put empty into sofar
  69.   put true into changed
  70.   set cursor to 4 -- watch
  71.   put the number of buttons into numicons
  72.   -- get initial list of icons
  73.   put field 1 of card "Temp Work Storage" into iconlist
  74.   put empty into used
  75.   repeat with j = 1 to numicons
  76.     put false into ok
  77.     repeat until ok
  78.       put (139 + random(numicons)) into theicon
  79.       -- check or make list of icons already used
  80.       if offset(theicon,used) = 0 then
  81.         put theicon && empty after used
  82.         put (theicon - 140) into theicon2
  83.         if not geticon(theicon) then put 140 + (theicon2 mod 36) into theicon
  84.         -- such an icon does not exist in the resources
  85.         put true into ok
  86.         set icon of button j to theicon
  87.         set hilite of button j to false
  88.         show button j
  89.         -- put the new icon no, into list
  90.         -- that HyperCard bug again - it can't handle complex things
  91.         -- put ((theicon mod 36) + 1) into first item of word j of iconlist
  92.         put word j of iconlist into temp
  93.         put second item of temp into layer
  94.         put third item of temp into row
  95.         -- need + 1 since we test for icon = 0
  96.         put ((theicon2 mod 36) + 1) into theicon
  97.         put theicon&","&layer&","&row into word j of iconlist
  98.         -- add more button attributes here
  99.       end if
  100.     end repeat
  101.   end repeat
  102.   -- put iconlist into msg -- debug
  103.   set cursor to 1 -- arrow
  104. end mouseUp
  105.  
  106.  
  107.  
  108. -- part 4 (button)
  109. -- low flags: 00
  110. -- high flags: A003
  111. -- rect: left=102 top=319 right=341 bottom=202
  112. -- title width / last selected line: 0
  113. -- icon id / first selected line: 0 / 0
  114. -- text alignment: 1
  115. -- font id: 0
  116. -- text size: 12
  117. -- style flags: 0
  118. -- line height: 16
  119. -- part name: Open
  120. ----- HyperTalk script -----
  121. -- Resume an existing game
  122.  
  123. on mouseUp
  124.   global icon1, icon2, numicons, iconlist, sofar, fname, changed
  125.   ask "Resume what Game" with fname
  126.   if (it is empty) or (the result is "Cancel") then exit mouseUp
  127.   put it into fname
  128.   set LockMessages to true
  129.   set LockScreen to true
  130.   go to card fname
  131.   if the result <> empty then
  132.     answer "No such Game" with "OK"
  133.     go to card "Hyper-GunShy Startup"
  134.     send mouseUp to me -- try again, recursive ???
  135.     exit mouseUp
  136.   end if
  137.   -- get the state of the game
  138.   set cursor to 4 -- watch
  139.   put field 1 into iconlist
  140.   put field 2 into sofar
  141.   put the number of words in iconlist into numicons
  142.   subtract the number of words in sofar from numicons
  143.   put 0 into icon1
  144.   put 0 into icon2
  145.   put true into changed
  146.   go to card "Hyper-GunShy Startup"
  147.   repeat with j = 1 to the number of buttons
  148.     set hilite of button j to false
  149.     show button j
  150.   end repeat
  151.   repeat with j = 1 to the number of words in sofar
  152.     put word j of sofar into temp
  153.     get first item of temp
  154.     hide button it
  155.   end repeat
  156.   set LockScreen to false
  157.   set LockMessages to false
  158. end mouseUp
  159.  
  160.  
  161.  
  162. -- part 6 (button)
  163. -- low flags: 00
  164. -- high flags: A003
  165. -- rect: left=306 top=319 right=341 bottom=406
  166. -- title width / last selected line: 0
  167. -- icon id / first selected line: 0 / 0
  168. -- text alignment: 1
  169. -- font id: 0
  170. -- text size: 12
  171. -- style flags: 0
  172. -- line height: 16
  173. -- part name: Save
  174. ----- HyperTalk script -----
  175. -- Save the game
  176.  
  177. on mouseUp
  178.   global numicons, sofar, iconlist, fname, changed
  179.   ask "Save as what game" with fname
  180.   if (it is empty) or (the result is "Cancel") then exit mouseUp
  181.   put it into fname
  182.   set LockScreen to true
  183.   set LockMessages to true
  184.   go to card fname
  185.   if the result is empty then
  186.     answer "OK to replace " & fname with "OK" or "Cancel"
  187.     if it is "Cancel" then
  188.       go to card "Hyper-GunShy Startup"
  189.       send mouseUp to me -- try again, recursive ???
  190.       exit mouseUp
  191.     end if
  192.   else
  193.     go to card "Temp Work Storage"
  194.     set cursor to 4 -- watch
  195.     doMenu "Copy Card"
  196.     doMenu "New Card"
  197.     doMenu "Paste Card"
  198.     set the name of this card to fname
  199.   end if
  200.   -- save the state of the game
  201.   put iconlist into field 1
  202.   put sofar into field 2
  203.   put false into changed
  204.   go to card "Hyper-GunShy Startup"
  205.   set LockScreen to false
  206.   set LockMessages to false
  207. end mouseUp
  208.  
  209.  
  210.  
  211. -- part 7 (button)
  212. -- low flags: 00
  213. -- high flags: 0000
  214. -- rect: left=416 top=316 right=341 bottom=459
  215. -- title width / last selected line: 0
  216. -- icon id / first selected line: 25002 / 25002
  217. -- text alignment: 1
  218. -- font id: 0
  219. -- text size: 12
  220. -- style flags: 0
  221. -- line height: 16
  222. -- part name: Do Help
  223. ----- HyperTalk script -----
  224. on mouseUp
  225.   push card
  226.   visual effect zoom open
  227.   go to card "Hyper-GunShy Help..."
  228. end mouseUp
  229.  
  230.  
  231.  
  232. -- part 8 (button)
  233. -- low flags: 00
  234. -- high flags: 0000
  235. -- rect: left=466 top=316 right=341 bottom=503
  236. -- title width / last selected line: 0
  237. -- icon id / first selected line: 1012 / 1012
  238. -- text alignment: 1
  239. -- font id: 0
  240. -- text size: 12
  241. -- style flags: 0
  242. -- line height: 16
  243. -- part name: Return
  244. ----- HyperTalk script -----
  245. -- Quit from game
  246.  
  247. on mouseUp
  248.   -- maybe ask user whether to save game first
  249.   visual effect iris close
  250.   pop card
  251. end mouseUp
  252.  
  253.  
  254.  
  255. -- part 9 (button)
  256. -- low flags: 00
  257. -- high flags: A003
  258. -- rect: left=204 top=319 right=341 bottom=304
  259. -- title width / last selected line: 0
  260. -- icon id / first selected line: 0 / 0
  261. -- text alignment: 1
  262. -- font id: 0
  263. -- text size: 12
  264. -- style flags: 0
  265. -- line height: 16
  266. -- part name: Restart
  267. ----- HyperTalk script -----
  268. -- Restart the current game
  269. on mouseUp
  270.   global icon1, icon2, num1, num2, sofar, numicons, changed
  271.   put 0 into icon1
  272.   put 0 into icon2
  273.   put 0 into num1
  274.   put 0 into num2
  275.   put true into changed
  276.   put the number of words of sofar into temp
  277.   -- only process icons that have gone
  278.   set cursor to 4 -- watch
  279.   repeat with j = 1 to temp
  280.     get word j of sofar
  281.     set hilite of button it to false
  282.     show button it
  283.   end repeat
  284.   set cursor to 1 -- arrow
  285.   put empty into sofar
  286.   put the number of buttons into numicons
  287. end mouseUp
  288.  
  289. -- quick & dirty utility routine to tidy up all icons
  290. -- to use, enter in msg : send "tidyup" to background button "Restart"
  291.  
  292. on tidyup
  293.   global icon1, icon2, num1, num2, sofar, numicons, changed
  294.   set cursor to 4 -- watch
  295.   put 0 into icon1
  296.   put 0 into icon2
  297.   put 0 into num1
  298.   put 0 into num2
  299.   put true into changed
  300.   put the number of buttons into numicons
  301.   put empty into sofar
  302.   repeat with j = 1 to numicons
  303.     set hilite of button j to false
  304.     show button j
  305.   end repeat
  306.   set cursor to 1 -- arrow
  307. end tidyup
  308.  
  309.  
  310.